﻿using System;
using System.Collections.Generic;
using System.Text;

using System.Text;
using HZ.Supervise.Model;
using System.Data;

namespace HZ.Supervise.IBLL
{
    public interface IBLL_MessageTypeDetail
    {
        /// <summary>
        /// 添加自定义规则
        /// </summary>
        /// <param name="MessageTypeDetal">model</param>
        /// <returns>1成功，0失败</returns>
        int InsertIntoMessageTypeDetail(Model.MessageTypeDetail MessageTypeDetal);

        /// <summary>
        /// 判断是否重复
        /// </summary>
        /// <param name="MessageTypeDetal">model</param>
        /// <returns>false 不重复 true 重复</returns>
        bool IsExistMessageTypeDetail(Model.MessageTypeDetail MessageTypeDetal);
        /// <summary>
        /// 根据条件查询规则
        /// </summary>
        /// <param name="messageTypeDetail">model</param>
        /// <param name="areaid">地区编号</param>
        /// <param name="currentpage">当前页</param>
        /// <param name="pagesize">分页大小</param>
        /// <param name="totalrecord">总数</param>
        /// <returns>messtypedetail</returns>
        DataTable GetMessageTypeDetail(Model.MessageTypeDetail messageTypeDetail, bool IsWork, string type, int currentpage, int pagesize, out int totalrecord);

        DataTable GetMessageTypeDetailByType(Model.MessageTypeDetail messageTypeDetail, string type, int currentpage, int pagesize, out int totalrecord);
        /// <summary>
        /// 获得信息
        /// </summary>
        /// <param name="message"> model</param>
        /// <param name="IsRead">true是,false否</param>
        /// <param name="currentpage">当前页</param>
        /// <param name="pagesize">分页大小</param>
        /// <param name="totalrecord">总数</param>
        /// <returns>message</returns>
        DataTable GetMessage(Model.Message message, bool IsRead, int currentpage, int pagesize, out int totalrecord);
        /// <summary>
        /// 获得预警信息的详情（连接采购单表包括采购信息）
        /// </summary>
        /// <param name="id">预警信息编号</param>
        /// <param name="currentpage">当前页</param>
        /// <param name="pagesize">每页最大数</param>
        /// <param name="totalrecord"></param>
        /// <returns>预警信息详情（包括采购单信息）</returns>
        DataTable GetMessageOrderDetail(string id, int currentpage, int pagesize, out int totalrecord);


        /// <summary>
        /// 查询预警信息详情(处方单药品预警)
        /// </summary>
        /// <param name="id">预警信息编号</param>
        /// <param name="currentpage">当前页</param>
        /// <param name="pagesize">每页最大数</param>
        /// <param name="totalrecord"></param>
        /// <returns>预警信息详情（包括采购单信息）</returns>
        DataTable GetMessageOrderDetailBySubsidy(string id, int currentpage, int pagesize, out int totalrecord);
        /// <summary>
        /// 查询预警信息详情(处方单预警)
        /// </summary>
        /// <param name="where">where条件</param>
        /// <param name="having">having条件</param>
        /// <param name="currentpage">当前页</param>
        /// <param name="pagesize">每页条数</param>
        /// <param name="totalrecord">总条数</param>
        /// <returns>详情</returns>
        DataTable GetMessageOrderDetailBySubsidy(string where, string having, int currentpage, int pagesize, out int totalrecord);

        /// <summary>
        /// 查询处方单详情
        /// </summary>
        /// <param name="pid">处方单ID</param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        DataTable GetMessagePrescriptionDetail(string pid, int currentpage, int pagesize, out int totalrecord, out Model.Prescription p);

        /// <summary>
        /// 删除预警
        /// </summary>
        /// <param name="messageTypeDetailId"></param>
        /// <returns></returns>
        int DeleteMessageTypeDetail(string messageTypeDetailId);
        /// <summary>
        /// 删除消息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        int DeleteMessage(string id);
        /// <summary>
        /// 启用预警
        /// </summary>
        /// <param name="messageDetailId"></param>
        /// <param name="isWork">启用预警和关闭预警</param>
        /// <returns></returns>
        int WarningSwitch(string messageDetailId, string isWork);

        /// <summary>
        /// 更新规则
        /// </summary>
        /// <param name="messTypeDetail">model</param>
        /// <returns>1成功，0失败</returns>
        int UpdateMessageTypeDetail(Model.MessageTypeDetail messTypeDetail);
        /// <summary>
        /// 设置此条信息为已读
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        int SetMessageIsRead(string id);


        /// <summary>
        /// 取得总规则
        /// </summary>
        /// <returns></returns>
        DataTable GetMessageType();

        /// <summary>
        /// 根据规则ID查询sqlwhere
        /// </summary>
        /// <param name="_strMessageTypeDetailId">规则编号</param>
        /// <returns>sqlstringwhere</returns>
        string GetMessageTypeDeatilSqlStringWhere(string _strMessageTypeDetailId);

        /// <summary>
        /// 根据规则ID查询sqlHaving
        /// </summary>
        /// <param name="_strMessageTypeDetailId">规则编号</param>
        /// <returns>sqlstringwhere</returns>
        string GetMessageTypeDeatilSqlStringHaving(string _strMessageTypeDetailId);

        /// <summary>
        /// 根据条件取得规则
        /// </summary>
        /// <param name="messType">model</param>
        /// <returns>datatable</returns>
        DataTable GetMessageType(Model.MessageTypeDetail messType, int IsRead, int currentpage, int pagesize, out int totalrecord);

        DataTable GetMessagSend(Model.MessageSend messSend, int currentpage, int pagesize, out int totalrecord);

        DataTable GetMessagSendNew(Model.MessageSend messSend, int isRead, int currentpage, int pagesize, out int totalrecord);

        DataTable GetDetailMessagSend(Model.MessageSend messSend, int currentpage, int pagesize, out int totalrecord);


        DataTable GetDetailMessagSendNew(Model.MessageSend messSend, int isRead, int currentpage, int pagesize, out int totalrecord);


        DataTable GetMessageForWindow();
        /// <summary>
        /// 获取当前用户的全部预警消息
        /// </summary>
        /// <returns></returns>
        DataTable GetMessagSendAll(string userid);


        #region 2011.4.9 赵洁 预警明细

        /// <summary>
        /// 配送企业已发货未开票详情
        /// </summary>
        /// <returns></returns>
        DataTable GetBllByType9(string orderDetailId, string h, string a, int currentpage, int pagesize, out int totalrecord);

        /// <summary>
        /// 配送企业已确认采购单未发货
        /// </summary>
        /// <returns></returns>
        DataTable GetBllByType8(string orderDetailId, string h, string a, int currentpage, int pagesize, out int totalrecord);

        /// <summary>
        /// 医院已提交企业未确认
        /// </summary>
        /// <returns></returns>
        DataTable GetBllByType3(string orderDetailId, string h, string a, int currentpage, int pagesize, out int totalrecord);



        /// <summary>
        /// 医院已入库未回款
        /// </summary>
        /// <returns></returns>
        DataTable GetBllByType7(string orderDetailId, string h, string a, int currentpage, int pagesize, out int totalrecord);


        /// <summary>
        /// 配送企业已确认医院未入库
        /// </summary>
        /// <param name="orderDetailId"></param>
        /// <param name="h"></param>
        /// <param name="a"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        DataTable GetBllByType6(string orderDetailId, string h, string a, int currentpage, int pagesize, out int totalrecord);


        /// <summary>
        /// 医院已提交退货单配送企业未确认
        /// </summary>
        /// <param name="orderDetailId"></param>
        /// <param name="h"></param>
        /// <param name="a"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        DataTable GetBllByType4(string orderDetailId, string h, string a, int currentpage, int pagesize, out int totalrecord);

        /// <summary>
        /// 医院已结算配送企业未确认
        /// </summary>
        /// <param name="orderDetailId"></param>
        /// <param name="h"></param>
        /// <param name="a"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        DataTable GetBllByType5(string orderDetailId, string h, string a, int currentpage, int pagesize, out int totalrecord);

        /// <summary>
        /// 医药监控
        /// </summary>
        /// <param name="h"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        DataTable GetMedicinModel(string h,string orderName,int currentpage, int pagesize, out int totalrecord);


        /// <summary>
        /// 药品监控
        /// </summary>
        /// <param name="orderDetailId"></param>
        /// <param name="h"></param>
        /// <param name="a"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
      
        /// <summary>
        /// 药品监控
        /// 查询where条件
        /// </summary>
        /// <param name="isRead"></param>
        /// <returns></returns>
        DataTable GetWhere(int isRead);


        /// <summary>
        /// 药品监控 根据条件查询数据
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        DataTable GetAll(DataTable dt, int currentpage, int pagesize, out int totalrecord);
        #endregion
    }
}
